package Services;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;

import dao.Implementation.SejourDAO;
import Donnees.Sejour;

@ManagedBean
public class sSejour {

	List<Sejour> listeSejour = new ArrayList<Sejour>();
	SejourDAO sejourDao = new SejourDAO();
	Sejour sejourTest = new Sejour();
	
	public List<Sejour> getListeSejour() {
		listeSejour = sejourDao.selectAll();
		return listeSejour;
	}
	public sSejour(){
		listeSejour = getListeSejour();
		sejourTest = listeSejour.get(0);
	}
	public void insertSejour(Sejour s) {
		sejourDao.insert(s);
	}
	public void deleteSejour(Sejour s) {
		sejourDao.delete(s);
	}
	public Sejour getSejourById(long id) {
		Sejour s = sejourDao.getById(id);
		return s;
	}
}
